

import pygame
import sys

pygame.init()

size=width,height=200,400
screen=pygame.display.set_mode(size)

pygame.display.set_caption("我是event")

f=open("pygame-event.txt","w")

while True:

    for e in pygame.event.get():
        f.write(str(e)+"\n")

        if(e.type==pygame.QUIT):
            f.close();
            sys.exit()
